@extends('admin.common.base-master')

@section('html-head')

@endsection

@section('html-body')
    <div id="content">
        <div id="cur-position">
            <span class="tit">当前位置：</span>
            <a href="#">医生管理</a>
            <em>&gt;</em>
            <a href="#">医生审核</a>
        </div>
        <!-- cur-position end -->

        <div class="gg-step2">

            <div class="list-wrap">
                <h2 class="head">
                    <span class="span1">医生详情</span>
                </h2>
                <div>
                    <img style="width: 110px;margin-left: 100px" src="@if($doctor){{route('Api.Image.Show',['id'=>$doctor->doc_img])}}@else{{route('Api.Image.Show',['id'=>0])}}@endif" />
                </div>
                <!-- list-text-box start -->
                <div class="list-text-box">
                    <div class="list-text">
                        <label class="tit">医生姓名：</label>
                        <div class="cont">
                            <p class="text">@if($doctor){{$doctor->doc_name}}@endif</p>
                        </div>
                    </div>
                    <div class="list-text">
                        <label class="tit">主治科目：</label>
                        <div class="cont">
                            <p class="text">@if($doctor){{$doctor->subject}}@endif</p>
                        </div>
                    </div>

                    <div class="list-text">
                        <label class="tit">性别：</label>
                        <div class="cont">
                            <p class="text">@if($doctor->sexual == 0)女@else男@endif</p>
                        </div>
                    </div>

                    <div class="list-text">
                        <label class="tit">岗位等级：</label>
                        <div class="cont">
                            <p class="text">@if($doctor){{$doctor->station}}@endif</p>
                        </div>
                    </div>
                    <div class="list-text">
                        <label class="tit">所在医院：</label>
                        <div class="cont">
                            <p class="text"><a>@if($doctor){{$doctor->hospital}} @endif</a></p>
                        </div>
                    </div>

                    <div class="list-text">
                        <label class="tit">医生公告：</label>
                        <div class="cont">
                            <p class="text">@if($doctor){{$doctor->notice}}@endif</p>
                        </div>
                    </div>
                    <div class="list-text">
                        <label class="tit">医生简介：</label>
                        <div class="cont">
                            <p class="text">@if($doctor){{$doctor->introduction}}@endif</p>
                        </div>
                    </div>
                    <div class="list-text">
                        <label class="tit">医生证书：</label>
                        <div class="cont">
                            <p class="text"><a href="@if($doctor){{route('Api.Image.Show',['id'=>$doctor->diploma_id])}}@endif" target="_blank">点击查看</a></p>
                        </div>
                    </div>


                    <div class="list-text">
                        <label class="tit">当前状态：</label>
                        <div class="cont">
                            @if((int)$doctor->is_work == 1)<span class="color4">通过</span> @elseif((int)$doctor->is_work == 0)<span class="color5">待审核</span>@else<span class="color3">不通过</span> @endif
                        </div>
                    </div>

                    <div class="list-btn-box">
                        <a href="javascript:void(0)" class="gg-revise" id="btn_pass" data-id="{{$doctor->user_id}}">通过</a>
                        <a href="javascript:void(0)" class="gg-del" id="btn_fire" data-id="{{$doctor->user_id}}">不通过</a>
                    </div>
                </div>
                <!-- list-text-box end -->
            </div>
        </div>
    </div>
    <script>
        $(function(){
            $(document).on("click","#btn_pass",function(){
                var id = $(this).attr("data-id");
                $.ajax({
                    url:"{{route('Api.Doctor.checkDoctor')}}",
                    type:"post",
                    dataType:"json",
                    data:{id:id,check:1},
                    success:function(obj){
                        if(obj.level == "success"){
                            noty({text:obj.message,type:obj.level,timeout:600,
                                callback:{
                                    afterClose:function(){
                                        window.location.href="{{route('Admin.Index.doctorList')}}";
                                    }
                                }
                            });
                        }else if(obj.level == "error"){
                            noty({text:obj.message,type:obj.level,timeout:600});
                        }
                    },
                    error:function(obj){
                        var datajson = obj.responseJSON;
                        noty({text: datajson.message, type: 'error', timeout: 600});
                    }
                });
            });
            $(document).on("click","#btn_fire",function(){
                var id = $(this).attr("data-id");
                $.ajax({
                    url:"{{route('Api.Doctor.checkDoctor')}}",
                    type:"post",
                    dataType:"json",
                    data:{id:id,check:2},
                    success:function(obj){
                        if(obj.level == "success"){
                            noty({text:obj.message,type:obj.level,timeout:600,
                                callback:{
                                    afterClose:function(){
                                        window.location.href="{{route('Admin.Index.doctorList')}}";
                                    }
                                }
                            });
                        }else if(obj.level == "error"){
                            noty({text:obj.message,type:obj.level,timeout:600});
                        }
                    },
                    error:function(obj){
                        var datajson = obj.responseJSON;
                        noty({text: datajson.message, type: 'error', timeout: 600});
                    }
                });
            });
        })
    </script>
@endsection

